var a, t = require("../../@babel/runtime/helpers/defineProperty"), o = getApp();

Page((t(a = {
    data: {
        clientData: [],
        clientType: "client",
        paidCustomerCount: 0,
        allCustomerCount: 0,
        page: 1,
        totalPage: 0,
        isLoadMore: !0
    },
    onLoad: function(a) {
        this.clientData();
    },
    onReachBottom: function() {
        console.log("是否执行"), this.data.isLoadMore ? this.getMoreData() : console.log("没有更多了");
    },
    onPullDownRefresh: function() {
        wx.showNavigationBarLoading(), wx.showLoading({
            title: "刷新中..."
        }), this.setData({
            page: 1
        }), this.clientData();
    },
    clientData: function() {
        var a = this, t = o.getNetAddresss("plugin.team-analysis.frontend.list.customerList"), e = {
            page: this.data.page
        };
        console.log(t + ">>>>>"), o._getNetWork({
            url: t,
            data: e,
            success: function(t) {
                var o = t.data, e = o.data.data;
                wx.hideLoading(), wx.hideNavigationBarLoading(), wx.stopPullDownRefresh(), 1 == o.result ? (a.data.isLoadMore = !0, 
                a.data.totalPage = o.data.last_page, a.data.totalPage || (a.data.totalPage = 0), 
                a.setData({
                    clientData: e,
                    allCustomerCount: o.data.all_customer_count,
                    paidCustomerCount: o.data.paid_customer_count
                })) : (a.data.page = a.data.page - 1, a.isLoadMore = !1, wx.showToast({
                    icon: "none",
                    title: o.msg,
                    duration: 1500
                })), console.log(a.data.clientData);
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    getMoreData: function() {
        var a = this;
        if (this.data.isLoadMore = !1, this.data.page >= this.data.totalPage) console.log("没有下拉加载"); else {
            this.data.page = this.data.page + 1;
            var t = o.getNetAddresss("plugin.team-analysis.frontend.list.customerList"), e = {
                page: this.data.page
            };
            console.log(t + ">>>>>"), o._getNetWork({
                url: t,
                data: e,
                success: function(t) {
                    var o = t.data, e = o.data.data;
                    console.log(o), 1 == o.result ? (a.data.isLoadMore = !0, a.setData({
                        clientData: a.data.clientData.concat(e)
                    })) : (a.data.page = a.data.page - 1, a.isLoadMore = !1, wx.showToast({
                        icon: "none",
                        title: o.msg,
                        duration: 1500
                    })), console.log(a.data.clientData);
                },
                fail: function(a) {
                    console.log(a);
                }
            });
        }
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {}
}, "onPullDownRefresh", function() {}), t(a, "onShareAppMessage", function() {}), 
a));